import React, { Component } from 'react';

class Content extends Component {
    state = {
        count:this.props.initVal
    };
    sub = () => {
        this.setState({
            count:this.state.count += 1
        })

    };
    render() {
        console.log(this.props);
        return (
            <div>
                <p>{this.props.match.params.id}</p>
                <span>{this.state.count}</span>
                <button onClick={this.sub} >click</button>
            </div>
        );
    }
}

export default Content;
